package com.itheima.utils.sort;

import java.util.Arrays;

public class 选择排序 {

    public static void main(String[] args) {

        //
        //

        int arr[] = {100,99,22,-1,0};

        for (int i = 0; i < arr.length - 1; i++) {
            int minIndex = i;
            int min = arr[minIndex];

            for (int j = 0 + i ;j<arr.length;j++){
                int current = arr[j];
                if(min > current){
                    minIndex = j;
                    min = current;
                }
            }

            arr[minIndex] = arr[i];
            arr[i] = min;
        }




        System.out.println(Arrays.toString(arr));

        //https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxbcc8fcf6755b68fd&redirect_uri=http%3a%2f%2fuy5sp9.natappfree.cc%2fpages%2findex.html&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect
    }
}
